JavaScript

A5.editsetSelection Method

Syntax

A5.edit.setSelection(element,start[,end])

Arguments

elementelement

The INPUT or TEXTAREA element to set the current selection of.

startnumber

The start of the selection.

endnumber

The end of the selection. If no value for end is passed in then the selection will be zero length.

Description

Set the current selection in an edit control (INPUT or TEXTAREA).

Example

// assume that "ele" is a DOM element pointer to an INPUT control, and that the last five characters of a twenty character value are to be selected.
var sel = A5.edit.setSelection(ele,14,19);